<?php

declare (strict_types=1);

namespace App\Model;

/**
 * @property int $id
 * @property int $user_id
 * @property int $cash_account_id
 * @property int $status
 * @property string $refuse_reason
 * @property int $draw_start_time
 * @property int $draw_end_time
 * @property string $amount
 * @property int $create_time
 * @property string $draw_type
 * @property int $user_type
 */
class AdvanceWithdraw extends Model
{
    public $timestamps = false;
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'advance_withdraw';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'integer', 'user_id' => 'integer', 'cash_account_id' => 'integer', 'status' => 'integer', 'draw_start_time' => 'integer', 'draw_end_time' => 'integer', 'create_time' => 'integer', 'user_type' => 'integer'];

    /**
     * 开始时间
     * @param int $value
     * @return string
     */
    public function getDrawStartTimeAttribute(int $value): string
    {
        return empty($value) ? "" : date('Y-m-d H:i:s', $value);
    }

    /**
     * 结束时间
     * @param int $value
     * @return string
     */
    public function getDrawEndTimeAttribute(int $value): string
    {
        return empty($value) ? "" : date('Y-m-d H:i:s', $value);
    }

    /**
     * 提现申请时间
     * @param int $value
     * @return string
     */
    public function getCreateTimeAttribute(int $value): string
    {
        return empty($value) ? "" : date("Y-m-d H:i:s", $value);
    }
}